package com.turing.post.salesmanage.impl;

import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.turing.post.salesmanage.util.GasAutoManagement;
import com.turing.post.salesmanage.util.GasAutoManagementDao;
import com.turing.post.util.GeneralDao;
import com.turing.post.util.PCPSApplicationException;

/**
 * @author zxp
 * @Apr 9, 2013
 */
@Stateless(mappedName = "salesmanage.impl.GasAutoManagementDaoImpl")
@Remote
@Local
public class GasAutoManagementDaoImpl implements GasAutoManagementDao {
	/**
	 * 实体管理器
	 * 
	 * @see javax.persistence.EntityManager
	 */
	@PersistenceContext
	protected EntityManager _em;

	@Override
	public void insert(GasAutoManagement gamg) throws PCPSApplicationException {
		GeneralDao.insert(_em, gamg);
	}

	@Override
	public void update(GasAutoManagement gamg) throws PCPSApplicationException {
		GeneralDao.update(_em, gamg);
	}

	@Override
	public GasAutoManagement getGasAutoManagementByPk(GasAutoManagement gamg) {
		return _em.find(GasAutoManagement.class, gamg);
	}
}
